home *** CD-ROM | disk | FTP | other *** search
/ PC Active 2009 September / PC Active NR.228.iso / intface / pca / tools / tools.js < prev    next >
Encoding:
JavaScript  |  2008-01-31  |  2.6 KB  |  68 lines

  1. /*
  2. versie 1.0 : Andre van Groenestein
  3. versie 1.5 : - algemene scripts verzameld in interactie.js
  4. */
  5.  
  6. function PopupVenster(nummer, soort)
  7. {
  8.     switch (soort)
  9.     {
  10.         case 'inst' : Item = tool[nummer + 1]; break;
  11.         case 'web'  : Item = tool[nummer + 2]; break;
  12.         case 'info' : Item = tool[nummer + 3]; break;
  13.     }
  14.  
  15.     ItemTitel    = tool[nummer];
  16.     PopupBreedte = 450;
  17.     PopupLengte  = 240;
  18.     if (soort == 'web')
  19.     {    PopupLengte  = 100;
  20.         PopupBreedte = Item.length * 7 + 65;
  21.     }
  22.     PCAinterfaceX = (screen.availWidth - PopupBreedte) / 2 - 5;
  23.     PCAinterfaceY = ((screen.availHeight - PopupLengte) / 2) - 19;
  24.     PopupWeergave = "resizable=no,status=no,scrollbars=no";
  25.     if ((Item.length * 0.5) + 85 > 300)
  26.     {    PopupWeergave = PopupWeergaveScroll;
  27.         // wordt gebruikt in window.open() functie. Bug in NS6:
  28.         // als slechts een venster wordt geopend, dus zonder bestand in te laden:
  29.         // window.open(""), worden toch geen scrollbars getoond. Wordt wel een
  30.         // bestand ingeladen: window.open("bestand"), dan verschijnen er
  31.         // wel scrollbars, maar pas als ze werkelijk nodig zijn...
  32.     }
  33.     if (soort == 'inst')
  34.     {    if (Item.lastIndexOf(".exe", Item.length - 1) != -1)
  35.             window.location.href = Item;
  36.         else if (Item.lastIndexOf(".htm", Item.length - 1) != -1)
  37.             lokaalVenster = window.open(Item, "lokaalvenster", "width=400,height=200,top=" + PCAinterfaceY + ",left=" + PCAinterfaceX + ",resizable=no,status=no,scrollbars=no")
  38.  
  39.     }
  40.     else
  41.     {    Bestand = "";
  42.         lokaalVenster = window.open(Bestand, "lokaalvenster", "width=" + PopupBreedte + ",height=" + PopupLengte + "," + PositieY + "=" + PCAinterfaceY + "," + PositieX + "=" + PCAinterfaceX + PopupWeergave);
  43.         PopupWeergave = "resizable=no,status=no,scrollbars=no";
  44.         SchrijfInhoud(Item, ItemTitel, PopupBreedte-60, nummer);
  45.     }
  46. }
  47.  
  48. function SchrijfInhoud(Item, ItemTitel, PopupBreedte, nummer)
  49. {    ldw('<html><head><title>Informatie</title>');
  50.     ldw('<link rel="STYLESHEET" type="text/css" href="../../styles/cdrom.css">');
  51.     ldw('<link rel="STYLESHEET" type="text/css" href="../pcactive.css">');
  52.     ldw('<script type="text/javascript" src="../popupsSluiten.js"></script>');
  53.     ldw('</head>');
  54.     ldw('<body background="../images/pcinfobk.gif">');
  55.     ldw('<div style="position:absolute; top:30px; left:40px; width:' + PopupBreedte + '">');
  56.     if (Item.substring(0, 4) == 'http')
  57.         ldw('<center><a class=weblink href="' + Item + '" target=WebVenster>' + Item + '</a></center>');
  58.     else
  59.     {    ldw('<b>' + ItemTitel + '</b><p>');
  60.         ldw(Item);
  61.         ldw('<p>');
  62.         ldw('<a href="javascript:opener.PopupVenster(' + nummer + ', \'inst\')">installeren</a>');
  63.     }
  64.     ldw('</div>');
  65.     ldw('</body></html>');
  66. }
  67.  
  68.